//
//  UIButton+extension.swift
//  swift3.0 遍历构造函数
//
//  Created by 龚昕炜 on 16/7/27.
//  Copyright © 2016年 龚昕炜. All rights reserved.
//

import UIKit

extension UIButton {
    
    convenience init(title: String, color: UIColor = UIColor.darkGray()) {
        
        self.init()
        
        /** 枚举类型创建 */
        self.setTitle(title, for: UIControlState.normal)
        /** 用枚举值创建 */
        self.setTitleColor(color, for: UIControlState(rawValue: 0))
        self.sizeToFit()
    }
    
}
